package com.advertisementsystem.entity;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("user")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @TableField("username") // 显式指定列名（如果不同）
    private String username;

    private String nickname;

    private String password;

    @TableField("role_type") // 显式指定列名（如果不同）
    private Integer roleType;

    private String phone;

    private String email;

    private Integer status;

    private LocalDateTime createdTime;

    private LocalDateTime updatedTime;

    private String avatar;

    // 这是一个非数据库字段，用于缓存计算属性
    @TableField(exist = false)
    private List<Role> roles;

}
